// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ITraceMessageFactory.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Contract for creating the <see cref="TraceMessageBase"/> instances. Reason for multiple types of trace messages is extensibility in serialization.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Diagnostics.CodeAnalysis;

namespace AzureContrib.WindowsAzure.Diagnostics
{
	/// <summary>
	/// Contract for creating the <see cref="TraceMessageBase"/> instances. Reason for multiple types of trace messages is extensibility in serialization.
	/// </summary>
	public interface ITraceMessageFactory
	{
		/// <summary>
		/// Creates an instance of a <see cref="TraceMessageBase"/>.
		/// </summary>
		/// <param name="level"><see cref="LogLevel"/> to trace to.</param>
		/// <param name="switch">Switch name of the current trace target.</param>
		/// <param name="message">The message to trace.</param>
		/// <returns>A <see cref="TraceMessageBase"/> with the supplied data.</returns>
		[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "switch", Justification = "The name switch is the right name for this context wich is switching traceing at different levels.")]
		TraceMessageBase Create(LogLevel level, string @switch, string message);

		/// <summary>
		/// Creates an instance of a <see cref="TraceMessageBase"/>.
		/// </summary>
		/// <param name="category">Category to trace to.</param>
		/// <param name="switch">Switch name of the current trace target.</param>
		/// <param name="message">The message to trace.</param>
		/// <returns>A <see cref="TraceMessageBase"/> with the supplied data.</returns>
		[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "switch", Justification = "The name switch is the right name for this context wich is switching traceing at different levels.")]
		TraceMessageBase Create(string category, string @switch, string message);
	}
}